package com.sp.shopping_search_customer_api;

import com.sp.shopping_common.Interceptor.JWTInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

// 拦截器配置
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
   @Override
  public void addInterceptors(InterceptorRegistry registry) {
    registry.addInterceptor(new JWTInterceptor())
         .addPathPatterns("/**") //拦截的接口
         .excludePathPatterns("/user/goodsSearch/autoSuggest"); //放行的接口
   }
}
